package com.bh.ly.oa.activity;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ListView;

import com.bh.ly.oa.BaseActivity;
import com.bh.ly.oa.R;
import com.bh.ly.oa.adapter.OrderDetailContentViewAdapter;

public class OrderDetailContentViewActivity extends BaseActivity implements OnClickListener{
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.order_detail_content_view);  
		initDatas(getIntent().getStringExtra("json"));
		ImageButton backBtn = (ImageButton) findViewById(R.id.back_button);
		backBtn.setImageResource(R.drawable.back);
		findViewById(R.id.title_layout).setVisibility(View.VISIBLE);
		backBtn.setOnClickListener(this);
	}

	private void initDatas(String data) {
		
		ListView listView1 = ((ListView) findViewById(R.id.order_detail_content_view));  
		listView1.setAdapter(new OrderDetailContentViewAdapter(this,data)); 
	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.back_button:
			finish();
			break;
		default:
			break;
		}
	}
}
